home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / patches / 40a-b_d7.zip / SETUP2.MS_ / SETUP2.bin
Text File  |  1993-07-20  |  63KB  |  1,702 lines

  1. '' $Keywords: setup2.mst 1.16 13Jul93 11:28am$ $nokeywords$
  2. '**************************************************************************
  3. '*                       CorelTools setup script
  4. '**************************************************************************
  5. ''    Date         Name                Reason
  6. ''-------------------------------------------------------------------------
  7. '' Feb 25 1992  Randall Mack    Modified from sample2.mst provided with
  8. ''                              Windows SDK 3.1 Beta.
  9. '' Feb 5    1993    Ibrahim Sallam    Modified for Draw 4.0
  10. '' Apr 24 1993    Ibrahim Sallam    Modified from Draw.mst Draw2.mst of Draw4
  11. '' May 1  1993    Ibrahim Sallam    Merging Net.mst with cdrom.mst in one file setup2.mst
  12.  
  13.  
  14. '$INCLUDE 'setupapi.inc'
  15.  
  16. ''C functions
  17. DECLARE SUB                InitializeInstall LIB "mscuistf.dll" (hInstance%, hMainWind% )
  18. DECLARE SUB                ShutDownInstall LIB "mscuistf.dll"
  19. DECLARE SUB                RegisterFont LIB "mscuistf.dll" (szFOTName$, szTTFName$) 
  20. DECLARE SUB                FileChangeString LIB "mscuistf.dll" (szFile1$, szFile2$, szString1$, szString2$)
  21. DECLARE SUB                FRecalcOptFiles LIB "mscuistf.dll" (iType%, szNeeds$)
  22. DECLARE FUNCTION    FIsDrawExist LIB "mscuistf.dll" (szFileName$, szDest$) AS INTEGER
  23. DECLARE FUNCTION    IsSectionKeyExist LIB "mscuistf.dll" (szSectionName$, szKeyName$) AS INTEGER
  24. DECLARE SUB             FAddFilesToList LIB "mscuistf.dll" (SectionName$, FiltersList$)
  25. DECLARE SUB             FAddFileToCopyList LIB "mscuistf.dll" (AppendSect$, Section$, FilterName$, SourceDir$, FiltersDir$) 
  26. DECLARE SUB                CommentIniSection LIB "mscuistf.dll" (szFileName$, szTempFile$, szSection$, szPath$ )
  27. DECLARE FUNCTION    GetFilenameFromPath LIB "mscuistf.dll" (szPath$) AS INTEGER
  28. DECLARE FUNCTION    IsTTFEnabled LIB "mscuistf.dll" AS INTEGER
  29. DECLARE SUB                InitScannerSelection LIB "mscuistf.dll" 
  30. DECLARE FUNCTION    FGetScannerLine LIB "mscuistf.dll" (szScannerDir$) AS INTEGER
  31. DECLARE SUB                CloseScannerSelection LIB "mscuistf.dll" 
  32. DECLARE SUB                FModifyFile LIB "mscuistf.dll" (szFileName$, szList$, szWhere$) 
  33. DECLARE FUNCTION    IsWinForWorkgroups LIB "mscuistf.dll" AS INTEGER
  34. DECLARE SUB       MakeFontSectList LIB "mscuistf.dll"
  35. DECLARE FUNCTION    VerifyNumber LIB "mscuistf.dll" (szSerialNumber$) AS INTEGER
  36.  
  37. '$INCLUDE 'setupvar.inc'
  38.  
  39. ''Strings for loading string resources
  40. GLOBAL szString$
  41. CONST     STRINGLEN =    128
  42. szString$ = string$( STRINGLEN+1, 32 )
  43.  
  44. ''setup main window
  45. CONST LOGO                            = 9100            ''must match the constant in dialogs.h
  46. SetTitle TR_TITLE
  47. SetBitmap "mscuistf.dll", LOGO
  48. InitializeInstall hinstFrame(), HwndFrame()        ''corel style buttons; max window
  49.  
  50. '$INCLUDE 'msdetect.inc'
  51.  
  52. '$DEFINE DEBUG  ''Define for script development/debugging
  53.  
  54. ''Dialog ID's
  55. ''Note: These constants MUST match the constants in dialogs.h
  56. CONST CDBASEDWELCOME    = 9941
  57. CONST NETWELCOME        = 9942
  58. CONST ASKQUIT                    = 9901
  59. CONST DESTPATH                   = 9902
  60. CONST ERROREXITFAILURE    = 9903
  61. CONST EXITQUIT                   = 9904
  62. CONST EXITSUCCESS                = 9905
  63. CONST TOOBIG                     = 9908
  64. CONST ERRORBADPATH           = 9909
  65. CONST SELECTFONTSYM            = 9917
  66. CONST SELECTFONTTT            = 9918
  67. CONST SELECTFONTTTCD        = 9821
  68. CONST WAIT                            = 9919
  69. CONST CDBASEDABOUT            = 9952
  70. CONST NETUSERABOUT            = 9951
  71. CONST ASKINSTALL                = 9922
  72. CONST WARNINGDESTPATH        = 9923
  73. ''CONST CUSTTTFONT                = 9924
  74. CONST BILLBOARD                    = 9926
  75. CONST UPDATEHELP             = 9929
  76. CONST UPDATEAUTOEXEC        = 9930
  77. CONST UPDATEAUTOEXECFORSHARE        = 9931
  78. CONST UPDATECONFIG            = 9934
  79. CONST WAITREGISTER            = 9932
  80. CONST SUCCESS                        = 9938
  81. CONST WAITCONFIGER            = 9939
  82. CONST WINREADONLY                = 9943
  83. CONST NETINSTWELCOME        = 9944
  84. CONST NETADDITEMFAILED    = 9949
  85. CONST NETADMINABOUT            = 9950
  86. CONST NETEXITSUCCESS      = 9948
  87. CONST WELCOMEHELP                = 9800
  88. CONST OPTIONSHELP                = 9801
  89. CONST DESTPATHHELP           = 9802
  90. CONST SELECTHELP            = 9806
  91. CONST ASKINSTALLHELP        = 9808
  92. CONST CUSTINSTHELP          = 9803
  93. CONST CUSTINSTCDBASED        = 9823
  94. CONST CUSTSCAN          = 9815
  95. CONST CUSTSCANHELP      = 9816
  96. CONST REGISTRATION      = 9817
  97. CONST REGISTRATIONBADNAME = 9818
  98. CONST REGISTRATIONBADSN = 9819
  99. CONST BILLBOARD1                = 9990
  100. CONST MOREFONTS         = 9824
  101.  
  102. ''Constants representing each line in the custinst dialog
  103. CONST DRAW          = 1
  104. CONST CHART         = 2
  105. CONST SHOW            = 3
  106. CONST PHOTO            = 4
  107. CONST MOVE            = 5
  108. CONST TRACE            = 6
  109. CONST MOSAIC        = 7
  110. CONST SCANNERS  = 8
  111. CONST FILTERS        = 9            ''Does not have custom dialog
  112. CONST FONTTT        = 10
  113. CONST NUMCUST      = FONTTT
  114. CONST MAIN            = NUMCUST + 1
  115. CONST NUMGROUPS    = MAIN
  116.  
  117. CONST FALSE    = 0
  118. CONST TRUE    = 1
  119.  
  120. '' used as values for afState(NUMCUST) array.
  121. CONST ALL        = 1
  122. CONST    SOME    = 2
  123. CONST    NONE    = 3
  124.  
  125. ''lists of reference keys for filters, fonts and symbols. 1 = install, 2 = don't
  126. GLOBAL FONTLIST1$
  127. FONTLIST1$        = "FontList1"
  128. GLOBAL FONTLIST2$
  129. FONTLIST2$        = "FontList2"
  130.  
  131. '' Scanners STUFF
  132. GLOBAL SCANNERLINE$
  133. SCANNERLINE$ = "ScannerLine"
  134. GLOBAL CONFIGLINE$
  135. CONFIGLINE$ = "ConfigLine"
  136. GLOBAL AUTOEXECLINE$
  137. AUTOEXECLINE$ = "AutoexecLine"
  138. GLOBAL SCANNERSECTION$
  139. SCANNERSECTION$ = "ScannerSection"
  140.  
  141.  
  142. ''information text for custom installation window
  143. GLOBAL STATUSTEXT$
  144. STATUSTEXT$  = "StatusItemsText"
  145. GLOBAL DRIVETEXT$
  146. DRIVETEXT$   = "DriveStatusText"
  147. GLOBAL DrivesList$            ''experemental variable for the drives list
  148. DrivesList$ = "DrivesList"
  149. GLOBAL TempList$                '' Used for Temp lists
  150. TempList$ = "TempList"
  151.  
  152. ''used as a parm to GetCopyListCost only
  153. GLOBAL EXTRACOSTS$
  154. EXTRACOSTS$ = "ExtraCosts"
  155. GLOBAL bTooBig%
  156. bTooBig% = FALSE
  157. GLOBAL bBadPath%
  158. bBadPath% = FALSE
  159. GLOBAL bBack%
  160. bBadPath% = FALSE
  161. GLOBAL bFullInstall%        '' TRUE ==> user went through Full Install Option
  162.  
  163. GLOBAL bAutoexecModified% '' TRUE ==> Config.sys has beed modified.
  164. bAutoexecModified% = FALSE
  165.  
  166. GLOBAL bDosScanner%    '' Did we install any Scanners? 
  167. bDosScanner% = FALSE
  168. GLOBAL bTwainScanner%    '' Did we install any Scanners? 
  169. bTwainScanner% = FALSE
  170.  
  171. GLOBAL bInstallWorkstation%            '' Are we installing a network Workstation?
  172.  
  173. ''list of sections (1..NUMGROUPS)
  174. GLOBAL afState(NUMCUST) AS INTEGER        ''list of selections for main options
  175. GLOBAL DIR(NUMGROUPS) AS STRING        ''list of directories for main options
  176. GLOBAL NUM(3) AS STRING                                ''string representations of 1 .. 3
  177. ''CustInst list of symbol names - each is a list of 26 numbers corresponding
  178. ''  to the space required on that numbered drive for the files in the
  179. ''  corresponding group
  180. GLOBAL aszNEEDS(NUMGROUPS) AS STRING
  181.  
  182. GLOBAL WINDIR$            ''Windows directory.
  183. GLOBAL WINSYSDIR$        ''Windows directory.
  184. GLOBAL WINDRIVE$        ''Windows drive letter.
  185. GLOBAL bWindowsIsNetworked%
  186. GLOBAL bWindowsForWorkgroups%
  187. GLOBAL DEST$            ''destination directory.
  188. GLOBAL SrcDir$      ''SrcDir of the CDROM or the Network files directory.
  189. GLOBAL szSymbolDir$        ''directory for Symbols 
  190. GLOBAL szDestScannersDir$''directory for scanner files
  191. GLOBAL szWWinDir$        ''Writable Windows directory
  192.  
  193. GLOBAL szFontSectDisk$
  194. szFontSectDisk$ = "FontSectDisk"
  195.  
  196. GLOBAL szUserName$            ''UserName for registration
  197. GLOBAL szSerialNumber$    ''SerialNumber for registration
  198.  
  199. GLOBAL TOOLGROUP$                    '' Group in which tools are to be installed
  200.  
  201. ''Windows version numbers
  202. GLOBAL WinMinor%
  203.  
  204. ''Variables to fake subroutines with parameters
  205. GLOBAL szFlist1a$
  206. GLOBAL szFlist1b$
  207. GLOBAL szFlist2a$
  208. GLOBAL szFlist2b$
  209. GLOBAL Dialog%
  210. GLOBAL SelectType%
  211. GLOBAL szOptions$
  212. GLOBAL bRecalcOpt%
  213.  
  214. ''TRUE => must do a global recalculation after GetPath - starts TRUE
  215. GLOBAL bRecalc%
  216.  
  217. ''Globals for WaitOn and WaitOff
  218. GLOBAL nWaiting%
  219. GLOBAL CursorSave%
  220.  
  221. ''local MSTest functions
  222. DECLARE SUB WaitOnBig
  223. DECLARE SUB WaitOn
  224. DECLARE SUB WaitOff
  225. DECLARE SUB SetDirectories
  226. DECLARE SUB PrepInstall
  227. DECLARE SUB AddOptFilesToCopyList( ftype% )
  228. DECLARE SUB RecalcOptFiles( fType% )
  229. DECLARE SUB RecalcPath
  230. DECLARE SUB SetDriveStatus
  231. ''''DECLARE SUB SetFontAndScannerDir
  232. DECLARE SUB    WrapFileChangeString( szFile1$, szFile2$, szString1$, szString2$ )
  233. DECLARE SUB    WrapCommentIniSection( szFileName$, szTempFile$, szSection$, szPath$ )
  234. DECLARE    SUB    CheckBackupFile( szFile1$, szFile2$ )
  235. DECLARE FUNCTION CreateProgmanItem (szGroup$, szItem$, szCmd$, szOther$, cmo%) AS INTEGER
  236. DECLARE FUNCTION MakePath( szDir$, szFile$ ) AS STRING
  237. DECLARE FUNCTION MakeDir( szDir$ ) AS STRING
  238. DECLARE SUB MakeFontList
  239. DECLARE SUB AddFilesToList (SectionName$, FiltersList$)
  240. DECLARE SUB AddFileToCopyList(AppendSect$, Section$, FilterName$) 
  241. DECLARE SUB TestAddSectionFilesToCopyList (szSection$,szFrom$,szTo$)
  242.  
  243.  
  244. INIT:
  245.     '' set waiting cursor
  246.     nWaiting% = 0
  247.     WaitOn
  248.     
  249.     ''Set default directory names
  250.     WINDIR$ = GetWindowsDir
  251.     WINSYSDIR$ = GetWindowsSysDir
  252.     WINDRIVE$ = MID$(WINDIR$, 1, 1)
  253.     bWindowsIsNetworked% = IsDriveNetwork( MID$(WINSYSDIR$,1,1) )
  254.     OpenLogfile MakePath(WINDIR$, TR_LOGFILE), 0
  255.     IF bWindowsIsNetworked% THEN
  256.         szWWinDir$ = WINDIR$            '' copy files to users personal directory
  257.         WriteToLogFile TR_NETWINDOWS
  258.     ELSE
  259.         szWWinDir$ = WINSYSDIR$        '' copy files to users Windows system directory
  260.     ENDIF
  261.     bWindowsForWorkgroups% = IsWinForWorkgroups
  262.     DEST$ = WINDRIVE$ + ":\"+TR_CORELDRW
  263.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  264. ''    DIR(MAIN) = MID$(SrcDir$,1,2)
  265.     SetDirectories
  266.     
  267.      IF bInstallWorkstation% THEN
  268.         WriteToLogFile TR_INSTALLNETUSER
  269.     ELSE
  270.         WriteToLogFile TR_INSTALLCDBASED
  271.     ENDIF
  272.         
  273.     ''find and read .inf file
  274.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  275.     IF szInf$ = "" THEN
  276.         szInf$ = MakePath( GetSymbolValue("STF_CWDDIR"), "setup2.inf" )
  277.     ENDIF
  278.     ReadInfFile szInf$
  279.     szInf$ = ""
  280.  
  281.     FOR i% = 1 TO MAIN
  282.          AddListItem STATUSTEXT$, ""
  283.     NEXT i%
  284.     ''We have 15 DRIVETEXT variables defined for 5 drives only
  285.     FOR i% = 1 TO 15
  286.         AddListItem DRIVETEXT$, ""
  287.     NEXT i%
  288.     
  289.     ''Disk cost list symbols
  290.     FOR i% = 1 TO NUMGROUPS STEP 1
  291.         aszNEEDS(i%)        = "DrawNeeds" + STR$(i%)
  292.     NEXT i%
  293.     
  294.     ''basic initialization
  295.     NUM(1) = "1"
  296.     NUM(2) = "2"
  297.     NUM(3) = "3"
  298.     ''Get Drives List
  299.     GetValidDrivesList(DrivesList$)
  300. '''' The Drives List will define the length of the EXTRACOSTS$
  301.     FOR i%=1 TO GetListLength(DrivesList$)
  302.         ''Disk cost list symbols
  303.         FOR j% = DRAW TO NUMGROUPS 
  304.             AddListItem aszNEEDS(j%), "0"
  305.         NEXT j%
  306.     NEXT i%
  307.     
  308.      WriteToLogFile "Before the Font Lists"
  309.       MakeFontSectList
  310.     WriteToLogFile "After the Font Lists"
  311.         
  312.     ''Set windows version - for use with installing windows 3.1 DLL's
  313.     '' 25Feb93: We wont install Draw4 on Win3.0.
  314.     '' 16Mar93: The following Check is not working YET.
  315. ''    WinMajor% = GetWindowsMajorVersion
  316. ''    WriteToLogFile "Windows Major Version is: " + STR$(WinMajor%)
  317.     WinMinor% = GetWindowsMinorVersion
  318. ''    WriteToLogFile "Windows Minor Version is: " + STR$(WinMinor%)
  319. ''    WriteToLogFile "Windows For Workgroups Installed Checking Return value: "+STR$(bWindowsForWorkgroups%)
  320.     
  321.     ''set the default progman group to put everything in
  322.     TOOLGROUP$    = TR_TOOLGROUP
  323.     
  324. '' Put up the Welcome dialog
  325. WELCOME:
  326.     '$IFDEF DEBUG
  327.         WriteToLogFile "WELCOME:"
  328.     '$ENDIF
  329.     WaitOff
  330.     IF bInstallWorkstation% THEN
  331.         Dialog% = NETWELCOME
  332.     ELSE
  333.         Dialog% = CDBASEDWELCOME
  334.     ENDIF
  335.     sz$ = UIStartDlg( "mscuistf.dll", Dialog%, "FInfoDlgProc", WELCOMEHELP, "FHelpDlgProc" )
  336.     SELECT CASE sz$
  337.     CASE "CONTINUE"
  338.         UIPop 1
  339.     CASE "ABOUT"
  340.         IF bInstallWorkstation% THEN
  341.             Dialog% = NETUSERABOUT
  342.         ELSE
  343.             Dialog% = CDBASEDABOUT
  344.         ENDIF
  345.         GOSUB INFO
  346.         GOTO WELCOME
  347.     CASE "REACTIVATE"
  348.         GOTO WELCOME
  349.     CASE ELSE
  350.         GOSUB ASKQUIT
  351.         GOTO WELCOME
  352.     END SELECT
  353.  
  354. IF bInstallWorkstation% = FALSE THEN
  355. ''Before we give him OPTIONs let's get the user name and his serial number.
  356. REGISTER:
  357.         '$IFDEF DEBUG
  358.             WriteToLogFile "REGISTER:"
  359.         '$ENDIF
  360.     AddListItem "EditText", ""
  361.     AddListItem "EditText", ""
  362. REGISTER1:
  363.     sz$ = UIStartDlg("mscuistf.dll", REGISTRATION, "FMultiEditDlgProc", 0, "")
  364.     SELECT CASE sz$
  365.     CASE "CONTINUE"
  366.         WaitOn
  367.         szUserName$ = RTRIM$(LTRIM$(GetListItem("EditText", 1)))
  368.         szSerialNumber$ = RTRIM$(LTRIM$(GetListItem("EditText", 2)))
  369.         IF szUserName$ = "" THEN
  370.             Dialog% = REGISTRATIONBADNAME
  371.             GOSUB INFO
  372.             GOTO REGISTER1
  373.         ENDIF
  374.         IF VerifyNumber(szSerialNumber$) = FALSE THEN
  375.             Dialog% = REGISTRATIONBADSN
  376.             GOSUB INFO
  377.             GOTO REGISTER1
  378.         ENDIF
  379.             
  380.     CASE "REACTIVATE"
  381.         GOTO REGISTER1
  382.     CASE ELSE
  383.         GOSUB ASKQUIT
  384.         GOTO REGISTER1
  385.     END SELECT
  386.     UIPop 1
  387. RemoveSymbol "EditText"
  388.  
  389. ENDIF ''bInstallWorkstation%
  390.  
  391. '' fall through from WELCOME
  392. '' Allow the user to select between full, minimal and custom installation
  393. '' OOPS, we removed minimum, so it's only FULL or CUSTOM.
  394. BEFOREINSTALL:
  395.     PrepInstall
  396.     GOSUB GETPATH
  397.     IF bBack% THEN
  398.         GOTO WELCOME
  399.     ENDIF
  400.     IF DoesDirExist(DIR(FONTTT)) OR DoesDirExist(DIR(SCANNERS)) THEN
  401.         GOSUB CUSTINST
  402.         IF bBack% THEN
  403.             GOTO BEFOREINSTALL
  404.         ENDIF
  405.     ENDIF
  406.  
  407. '' Install the neccessaty files, and the selected fonts and scanners.
  408. INSTALL:
  409.     '$IFDEF DEBUG
  410.         WriteToLogFile "INSTALL:"
  411.     '$ENDIF
  412.     WaitOn
  413.     ''Make sure there is enough space for CorelDRAW!
  414.         WaitOnBig
  415.         bRecalc% = FALSE
  416.         RecalcPath 
  417.         SetDriveStatus
  418.     IF bTooBig% THEN
  419.         Dialog% = TOOBIG
  420.         GOSUB INFO
  421.         ERROR STFQUIT
  422.     ENDIF
  423.     
  424.     ClearCopyList
  425.     ''Create all directories needed and assign all the files to copy
  426.     FOR i% = 1 TO NUMGROUPS STEP 1
  427.             AddOptFilesToCopyList i%
  428.     NEXT i%
  429.     
  430.         '' backup files to *.cor - do not overwrite
  431.         CheckBackupFile MakePath(WINDIR$,"win.ini"), MakePath(WINDIR$,"win.cor")
  432.         CheckBackupFile MakePath(WINDIR$,"reg.dat"), MakePath(WINDIR$,"reg.cor")
  433.         CheckBackupFile MakePath(WINDIR$,"progman.ini"), MakePath(WINDIR$,"progman.cor")
  434.     
  435.         IF DoesFileExist( MakePath(DIR(MAIN),TR_PROGRAMS+"\"+ TR_CORELDRW_EXE), femExists ) THEN 
  436.             CreateDir MakePath(DEST$,TR_DRAW), cmoNone
  437.             CreateDir MakePath( DEST$, TR_DRAW+"\"+TR_AUTOBACK ), cmoNone
  438.             CreateDir MakePath( DEST$, TR_DRAW+"\"+TR_TEMPLATE ), cmoNone
  439.         ENDIF
  440.         IF DoesFileExist( MakePath(DIR(MAIN),TR_PROGRAMS+"\"+ TR_CORELCHT_EXE), femExists ) THEN 
  441.             CreateDir MakePath(DEST$,TR_CHART), cmoNone
  442.         ENDIF
  443.         IF DoesFileExist( MakePath(DIR(MAIN),TR_PROGRAMS+"\"+ TR_CORELSHW_EXE), femExists ) THEN 
  444.             CreateDir MakePath(DEST$,TR_SHOW), cmoNone
  445.         ENDIF
  446.         IF DoesFileExist( MakePath(DIR(MAIN),TR_PROGRAMS+"\"+ TR_CORELPNT_EXE), femExists ) THEN 
  447.             CreateDir MakePath(DEST$,TR_PHOTOPNT), cmoNone
  448.         ENDIF
  449.         IF DoesFileExist( MakePath(DIR(MAIN),TR_PROGRAMS+"\"+ TR_CORELMOV_EXE), femExists ) THEN 
  450.             CreateDir MakePath(DEST$,TR_MOVE), cmoNone
  451.         ENDIF
  452.         IF szSymbolDir$ <> "" THEN 
  453.             CreateDir MakePath(DEST$,TR_SYMBOLS), cmoNone
  454.         ENDIF
  455.     
  456.      '' If installing as a network administrator, copy redists to redist dir
  457.     
  458.      '' Add billboards
  459.     BilBrd% = BILLBOARD1 
  460.     FOR i% = 0 TO 5 STEP 1
  461.         AddToBillBoardList "mscuistf.dll", BilBrd+i%, "FModelessBillBoardDlgProc", 20
  462.     NEXT i%
  463.     
  464.     ''Copy all the files over
  465.     WaitOff
  466.         CopyFilesInCopyList
  467.     WaitOn
  468.         
  469.     '' if installing as a network administrator don't create .fot files
  470.         '' Register all the ttf fonts with Windows
  471.         IF IsTTFEnabled = 1 AND DoesDirExist(DIR(FONTTT)) THEN
  472.             WriteToLogFile "**** TTFEnabled ****"
  473.                 sz$ = UIStartDlg("mscuistf.dll", WAITREGISTER, "FModelessDlgProc", 0, "")
  474.             '' Let's register the Symbols TTF,... FONTLIST1$ is an empty Symbole varaible
  475.                 IF szSymbolDir <> "" THEN
  476.                     MakeListFromSectionKeys TempList$, "WFN"
  477.                     FOR i% = 1 TO GetListLength(TempList$)
  478.                         szFileName$ = GetSectionKeyFilename( "WFN", GetListItem(TempList$, i%))
  479.                         IF DoesFileExist( MakePath(DEST$, TR_SYMBOLS +"\"+ szFileName$),  femExists) THEN
  480. ''                        WriteToLogFile "In Symbols: FileName: " + szFileName2$
  481.                             IF MID$(szFileName$, LEN(szFileName$)-2) = "ttf" THEN
  482.                                 index% = GetFilenameFromPath( szFileName$ )
  483.                                 szFileName2$ = MID$( szFileName$, index%, LEN(szFileName$) - index% + 1 )
  484. ''                            WriteToLogFile "This is a TTF file let's register " 
  485.                                 szFOTName$ = MID$(szFileName2$,1,LEN(szFileName2$)-3) + "fot"
  486. ''                            WriteToLogFile "This is the filename:"+ MID$(szFileName$, 1, LEN(szFileName$)-3) 
  487.                                 RegisterFont MakePath(szWWinDir$,szFOTName$), MakePath(DEST$, TR_SYMBOLS+"\"+ szFileName$)
  488.                                 temp% = GetTypeFaceNameFromTTF( MakePath(DEST$, TR_SYMBOLS+"\"+ szFileName$), szString$, STRINGLEN )
  489.                                 IF temp% > 0 AND temp% < STRINGLEN THEN
  490.                                     CreateIniKeyValue TR_WIN_INI, "fonts", szString$+" "+TR_TRUETYPE, UCASE$(szFOTName$), cmoOverWrite
  491.                                 ENDIF
  492.                             ENDIF
  493.                         ENDIF
  494.                     NEXT i%
  495.                 ENDIF
  496.                     
  497.             ''Lets register Avante Garde Book first, it's always been installed.
  498.             MakeListFromSectionKeys TempList$, "DrawFonts"
  499.             FOR i% = 1 TO GetListLength(TempList$)
  500.                 szFileName$ = GetSectionKeyFileName("DrawFonts", GetListItem(TempList$, i%))
  501.                 index% = GetFilenameFromPath( szFileName$ )
  502.                 szFileName2$ = MID$( szFileName$, index%, LEN(szFileName$) - index% + 1 )
  503.                 IF bInstallWorkstation% THEN
  504.                     szFontFile$ = szFileName2$
  505.                 ELSE
  506.                     szFontFile$ = szFileName$
  507.                 ENDIF
  508.                 IF DoesFileExist( MakePath(DIR(FONTTT), szFontFile$),  femExists) THEN
  509.                     szFOTName$ = MID$(szFileName2$,1,LEN(szFileName2$)-3) + "fot"
  510.                     RegisterFont MakePath(szWWinDir$,szFOTName$), MakePath(DIR(FONTTT),szFontFile$)
  511.                         temp% = GetTypeFaceNameFromTTF( MakePath(DIR(FONTTT),szFontFile$), szString$, STRINGLEN )
  512.                         IF temp% > 0 AND temp% < STRINGLEN THEN
  513.                             CreateIniKeyValue TR_WIN_INI, "fonts", szString$+" "+TR_TRUETYPE, UCASE$(szFOTName$), cmoOverWrite
  514.                         ENDIF
  515.                 ENDIF
  516.             NEXT i%
  517.             
  518.             IF afState(FONTTT) <> NONE THEN
  519.                 WriteToLogFile "afState(FONTTT) <> NONE"
  520.                 IF afState(FONTTT) = ALL THEN
  521.                     MakeFontList                    
  522.                 ENDIF
  523.                 FOR nIndex% = 1 TO GetListLength(FONTLIST2$)
  524.                     FOR i% = 1 TO GetListLength(szFontSectDisk$)
  525.                         IF IsSectionKeyExist( GetListItem(szFontSectDisk$, i%), GetListItem(FONTLIST2$, nIndex%)) THEN
  526.                             szFileName$ = GetSectionKeyFilename( GetListItem(szFontSectDisk$, i%), GetListItem(FONTLIST2$, nIndex%))
  527.                             EXIT FOR
  528.                         ENDIF
  529.                     NEXT i%                            
  530.                     index% = GetFilenameFromPath( szFileName$ )
  531.                     szFileName2$ = MID$( szFileName$, index%, LEN(szFileName$) - index% + 1 )
  532.                     IF bInstallWorkstation% THEN
  533.                         szFontFile$ = szFileName2$
  534.                     ELSE
  535.                         szFontFile$ = szFileName$
  536.                     ENDIF
  537.                     IF DoesFileExist( MakePath(DIR(FONTTT), szFontFile$),  femExists) THEN
  538.                         szFOTName$ = MID$(szFileName2$,1,LEN(szFileName2$)-3) + "fot"
  539.                         RegisterFont MakePath(szWWinDir$,szFOTName$), MakePath(DIR(FONTTT),szFontFile$)
  540.                         temp% = GetTypeFaceNameFromTTF( MakePath(DIR(FONTTT),szFontFile$), szString$, STRINGLEN )
  541.                         IF temp% > 0 AND temp% < STRINGLEN THEN
  542.                             CreateIniKeyValue TR_WIN_INI, "fonts", szString$+" "+TR_TRUETYPE, UCASE$(szFOTName$), cmoOverWrite
  543.                         ENDIF
  544.                     ENDIF
  545.                     szString$ = string$( STRINGLEN+1, 32 )
  546.                     szFileName$ = ""
  547.                     szFileName2$ = ""
  548.                     szFOTName$ = ""
  549.                 NEXT nIndex%
  550.                 UIPop 1
  551.             ENDIF
  552.         ENDIF
  553.     
  554.     '' When installing as a network administrator, register nothing
  555.     
  556.         sz$ = UIStartDlg("mscuistf.dll", WAITCONFIGER, "FModelessDlgProc", 0, "")
  557.         
  558.          nAddItemFailed% = 0
  559.         
  560.         '' Updating the INI files in the Config directory    only if an APP installed.
  561.         IF DoesDirExist( MakePath(DEST$, TR_CONFIG) ) THEN
  562.             CreateIniKeyValue TR_WIN_INI, "CorelGraphics4", "Dir", MakePath(DEST$,TR_CONFIG), cmoOverWrite
  563.         ENDIF
  564.         IF bWindowsIsNetworked% = TRUE AND DoesFileExist( MakePath(WINSYSDIR$,"ole2.dll"), femExists ) = 1 THEN 
  565.             RUN( TR_REGLOAD_S + " " + MakePath(WINSYSDIR$, "OLE2.REG") )
  566.         ELSE
  567.             RUN( TR_REGLOAD_S + " " + MakePath(szWWinDir$, "OLE2.REG") )
  568.         ENDIF
  569.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+TR_CORELAPP_INI), femExists) THEN
  570.             ini$ = MakePath( DEST$, TR_CONFIG+"\"+TR_CORELAPP_INI)
  571.                 CreateIniKeyValue ini$, "Config", "ProgramsDir", MakePath(DIR(MAIN),TR_PROGRAMS), cmoOverWrite
  572.                 CreateIniKeyValue ini$, "Config", "DataDir", MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_DATA), cmoOverWrite
  573.                 CreateIniKeyValue ini$, "Config", "CustomDir", MakePath(DEST$,TR_CUSTOM), cmoOverWrite
  574.                 CreateIniKeyValue ini$, "Config", "DrawDir", MakePath(DEST$,TR_DRAW), cmoOverWrite
  575.                 CreateIniKeyValue ini$, "Config", "ChartDir", MakePath(DEST$, TR_CHART), cmoOverWrite
  576.                 CreateIniKeyValue ini$, "Config", "ShowDir", MakePath(DEST$, TR_SHOW), cmoOverWrite
  577.                 CreateIniKeyValue ini$, "Config", "PhotoPaintDir", MakePath(DEST$, TR_PHOTOPNT), cmoOverWrite
  578.                 CreateIniKeyValue ini$, "Config", "MoveDir", MakePath(DEST$, TR_MOVE), cmoOverWrite
  579.                 CreateIniKeyValue ini$, "Config", "TraceDir", MakePath(DEST$, TR_TRACE), cmoOverWrite
  580.                 CreateIniKeyValue ini$, "Config", "MosaicDir", MakePath(DIR(MAIN),TR_PROGRAMS), cmoOverWrite
  581.                 CreateIniKeyValue ini$, "Config", "FontsDir", MakePath(DEST$,TR_SYMBOLS), cmoOverWrite
  582.                 CreateIniKeyValue ini$, "Config", "FiltersDir", MakePath(DIR(MAIN),TR_PROGRAMS), cmoOverWrite
  583.                 CreateIniKeyValue ini$, "Registration", "UserName", szUserName$, cmoOverWrite
  584.                 CreateIniKeyValue ini$, "Registration", "SerialNumber", szSerialNumber$, cmoOverWrite
  585.             ini$ = MakePath( DEST$, TR_CONFIG+"\"+TR_CORELPRN_INI)
  586.                 CreateIniKeyValue ini$, "ColorPath", "CircuitPath", MakePath(DEST$,TR_CUSTOM), cmoOverwrite
  587.             ini$ = MakePath( DEST$, TR_CONFIG+"\"+TR_CORELFLT_INI)
  588.                 CreateIniKeyValue ini$, "ColorPath", "CircuitPath", MakePath(DEST$,TR_CUSTOM), cmoOverWrite
  589.                 CreateIniKeyValue ini$, "ColorPath", "CurvePath", MakePath(DEST$,TR_CUSTOM), cmoOverWrite
  590.                 WrapCommentIniSection ini$, MakePath(DEST$,"___temp_"), "ImportFilters", MakePath(DIR(MAIN),TR_PROGRAMS+"\")
  591.                 WrapCommentIniSection ini$, MakePath(DEST$,"___temp_"), "ExportFilters", MakePath(DIR(MAIN),TR_PROGRAMS+"\")
  592.                 WrapCommentIniSection ini$, MakePath(DEST$,"___temp_"), "CorelAIExport", MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_DATA+"\")
  593.                 WrapCommentIniSection ini$, MakePath(DEST$,"___temp_"), "CorelDXFExport", MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_DATA+"\")
  594.             ini$ = MakePath( DEST$, TR_CONFIG+"\"+TR_CORELFNT_INI)
  595.                 WrapCommentIniSection ini$, MakePath(DEST$,"___temp_"), "Fonts", MakePath(DEST$, TR_SYMBOLS+"\")
  596.                 WrapCommentIniSection ini$, MakePath(DEST$,"___temp_"), "Symbols", MakePath(DEST$, TR_SYMBOLS+"\")
  597.                 CreateProgmanGroup TOOLGROUP$, "", cmoNone
  598.                 ShowProgmanGroup  TOOLGROUP$, 1, cmoNone
  599.         ENDIF ''DoesFileExist    CORELAPP_INI
  600.         
  601.         IF DoesFileExist( MakePath(DIR(MAIN), TR_README_WRI), femExists) THEN
  602.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_RELEASENOTES, TR_WRITE_EXE + " " + MakePath(DIR(MAIN),TR_README_WRI), "", cmoOverwrite)
  603.         ENDIF
  604.  
  605.                 '' setup coreldrw.reg
  606.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+TR_CORELDRW_REG), femExists) THEN
  607.                 WrapFileChangeString MakePath(DEST$,TR_CONFIG+"\"+TR_CORELDRW_REG), MakePath(DEST$,"___temp_"), TR_CORELDRW_EXE, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELDRW_EXE)
  608.                 WrapFileChangeString MakePath(DEST$,TR_CONFIG+"\"+TR_CORELDRW_REG), MakePath(DEST$,"___temp_"), TR_CDROL140_DLL, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CDROL140_DLL)
  609.                 RUN( TR_REGLOAD_S + " " + MakePath(DEST$,TR_CONFIG+"\"+TR_CORELDRW_REG) )
  610.         ENDIF
  611.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+TR_CORELDRW_INI), femExists)  THEN
  612.                 ini$ = MakePath(DEST$, TR_CONFIG+"\"+TR_CORELDRW_INI)
  613.                     CreateIniKeyValue ini$, "Config", "AutoBackupDir", MakePath(DEST$,TR_DRAW+"\"+TR_AUTOBACK), cmoOverwrite
  614.                     CreateIniKeyValue ini$, "Config", "TemplateDir", MakePath(DEST$,TR_DRAW+"\"+TR_TEMPLATE), cmoOverwrite
  615.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELDRAW, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELDRW_EXE),"", cmoOverwrite)
  616.         ENDIF
  617.  
  618.                 '' setup corelcht.reg
  619.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+TR_CORELCHT_REG), femExists) THEN
  620.                 WrapFileChangeString MakePath(DEST$,TR_CONFIG+"\"+TR_CORELCHT_REG), MakePath(DEST$,"___temp_"), TR_CORELCHT_EXE, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELCHT_EXE)
  621.                 WrapFileChangeString MakePath(DEST$,TR_CONFIG+"\"+TR_CORELCHT_REG), MakePath(DEST$,"___temp_"), TR_CDROL140_DLL, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CDROL140_DLL)
  622.                 RUN( TR_REGLOAD_S + " " + MakePath(DEST$,TR_CONFIG+"\"+TR_CORELCHT_REG) )
  623.         ENDIF
  624.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+TR_CORELCHT_INI), femExists) THEN
  625.                 ini$ = MakePath(DEST$, TR_CONFIG+"\"+"CORELCHT.INI")
  626.                     CreateIniKeyValue ini$, "Config", "Vector_path", MakePath(DIR(MAIN),TR_CLIPART+"\"+TR_VECTORS), cmoOverwrite
  627.                     CreateIniKeyValue ini$, "Templates", "1", CHR$(34)+"Bar"+CHR$(34)+","+MakePath(DIR(CHART),TR_BAR), cmoOverwrite
  628.                     CreateIniKeyValue ini$, "Templates", "2", CHR$(34)+"Line"+CHR$(34)+","+MakePath(DIR(CHART),TR_LINE), cmoOverwrite
  629.                     CreateIniKeyValue ini$, "Templates", "3", CHR$(34)+"Area"+CHR$(34)+","+MakePath(DIR(CHART),TR_AREA), cmoOverwrite
  630.                     CreateIniKeyValue ini$, "Templates", "4", CHR$(34)+"Pie"+CHR$(34)+","+MakePath(DIR(CHART),TR_PIE), cmoOverwrite
  631.                     CreateIniKeyValue ini$, "Templates", "5", CHR$(34)+"Scatter"+CHR$(34)+","+MakePath(DIR(CHART),TR_SCATTER), cmoOverwrite
  632.                     CreateIniKeyValue ini$, "Templates", "6", CHR$(34)+"High/Low/Open/Close"+CHR$(34)+","+MakePath(DIR(CHART),TR_HILO), cmoOverwrite
  633.                     CreateIniKeyValue ini$, "Templates", "7", CHR$(34)+"Spectral_Maps"+CHR$(34)+","+MakePath(DIR(CHART),TR_SPECTRAL), cmoOverwrite
  634.                     CreateIniKeyValue ini$, "Templates", "8", CHR$(34)+"Histograms"+CHR$(34)+","+MakePath(DIR(CHART),TR_HIST), cmoOverwrite
  635.                     CreateIniKeyValue ini$, "Templates", "9", CHR$(34)+"Table_Charts"+CHR$(34)+","+MakePath(DIR(CHART),TR_TABLE), cmoOverwrite
  636.                     CreateIniKeyValue ini$, "Templates", "10", CHR$(34)+"3D-Riser"+CHR$(34)+","+MakePath(DIR(CHART),TR_3DRISER), cmoOverwrite
  637.                     CreateIniKeyValue ini$, "Templates", "11", CHR$(34)+"3D-Scatter"+CHR$(34)+","+MakePath(DIR(CHART),TR_3DSCAT), cmoOverwrite
  638.                     CreateIniKeyValue ini$, "Templates", "12", CHR$(34)+"Pictographs"+CHR$(34)+","+MakePath(DIR(CHART),TR_PICTO), cmoOverwrite
  639.                     CreateIniKeyValue ini$, "Templates", "13", CHR$(34)+"Samples"+CHR$(34)+","+MakePath(DIR(CHART),TR_SAMPLES), cmoOverwrite
  640.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELCHART, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELCHT_EXE), "", cmoOverwrite)
  641.         ENDIF '' DoesFileExist CORELCHT_INI
  642.  
  643.                 '' setup corelshw.reg
  644.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+TR_CORELSHW_REG), femExists) THEN
  645.                 WrapFileChangeString MakePath(DEST$,TR_CONFIG+"\"+TR_CORELSHW_REG), MakePath(DEST$,"___temp_"),TR_CORELSHW_EXE, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELSHW_EXE)
  646.                 RUN( TR_REGLOAD_S + " " + MakePath(DEST$,TR_CONFIG+"\"+TR_CORELSHW_REG) )
  647.         ENDIF
  648.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+TR_CORELSHW_INI), femExists) THEN
  649.                 ini$ = MakePath(DEST$, TR_CONFIG+"\"+TR_CORELSHW_INI)
  650.                     CreateIniKeyValue ini$, "HomeDirectories", "Presentations", MakePath(DIR(SHOW), TR_SAMPLES), cmoOverwrite
  651.                     CreateIniKeyValue ini$, "HomeDirectories", "Animations", MakePath(DIR(SHOW),TR_SAMPLES), cmoOverwrite
  652.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELSHOW, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELSHW_EXE), "", cmoOverwrite)
  653.                 CreateIniKeyValue TR_WIN_INI, "AAPLAY Animation", "WaveAudio", "c,522", cmoOverWrite
  654.                 CreateIniKeyValue TR_WIN_INI, "AAPLAY Animation", "Sequencer", "x,523", cmoOverWrite
  655.                 CreateIniKeyValue TR_WIN_INI, "AAPLAY Animation", "FullScreen", "AAVGA.DLL", cmoOverWrite
  656.                 CreateIniKeyValue TR_WIN_INI, "AAPLAY Animation", "DualScreen", "no", cmoOverWrite
  657.         ENDIF ''DoesFileExist CORELSHW_INI
  658.  
  659.                 '' Register photo with OLE
  660.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+TR_CORELPNT_REG), femExists) THEN
  661.                 WrapFileChangeString MakePath(DEST$,TR_CONFIG+"\"+TR_CORELPNT_REG), MakePath(DEST$,"___temp_"),TR_CORELPNT_EXE, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELPNT_EXE)
  662.                 WrapFileChangeString MakePath(DEST$,TR_CONFIG+"\"+TR_CORELPNT_REG), MakePath(DEST$,"___temp_"),TR_PNTHNDLR_DLL, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_PNTHNDLR_DLL)
  663.                 RUN( TR_REGLOAD_S + " " + MakePath(DEST$,TR_CONFIG+"\"+TR_CORELPNT_REG) )
  664.         ENDIF
  665.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+TR_CORELPNT_INI), femExists) THEN
  666.                 ini$ = MakePath(DEST$,TR_CONFIG+"\"+TR_CORELPNT_INI)
  667.                     CreateIniKeyValue ini$, "CorelPaintDll", "PCX 16 Color/Gray", MakePath(DIR(MAIN),TR_PROGRAMS+"\"+"pcx16.dll,*.pcx"), cmoOverWrite
  668.                     CreateIniKeyValue ini$, "ARTIST", "Path", MakePath(DIR(PHOTO),TR_BRUSHES+"\"), cmoOverWrite
  669.                     CreateIniKeyValue ini$, "COLORSELECT", "Brush", MakePath(DIR(PHOTO),TR_BRUSHES+"\"+TR_PNTBRUSH_BMP), cmoOverWrite
  670.                     CreateIniKeyValue ini$, "COLORSELECT", "Area", MakePath(DEST$,TR_PHOTOPNT+"\"+TR_COLORS+"\"+TR_DEFAULT_CLR), cmoOverWrite
  671.                     CreateIniKeyValue ini$, "CANVAS", "Canvas", MakePath(DIR(PHOTO),TR_CANVAS+"\"+TR_CANVAS_PCX), cmoOverWrite
  672.                     CreateIniKeyValue ini$, "ColorPath", "CircuitPath", MakePath(DEST$,TR_CUSTOM), cmoOverWrite
  673.                     CreateIniKeyValue ini$, "ColorPath", "CurvePath", MakePath(DEST$,TR_CUSTOM), cmoOverWrite
  674.                     CreateIniKeyValue ini$, "ColorPath", "TargetPath", MakePath(DEST$,TR_CUSTOM), cmoOverWrite
  675.                     CreateIniKeyValue ini$, "FILL", "Fill", MakePath(DIR(PHOTO),TR_TILES+"\"+"SAND.PCX"), cmoOverWrite
  676.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELPHOTO, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELPNT_EXE), "", cmoOverwrite)
  677.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CCAPTURE, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CCAPTURE_EXE), "", cmoOverwrite)
  678.         ENDIF  '' DoesFileExist CORELPNT_INI
  679.         
  680.                 '' Register move with OLE
  681.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+"corelmov.reg"), femExists) THEN
  682.                 WrapFileChangeString MakePath(DEST$,TR_CONFIG+"\"+"corelmov.reg"), MakePath(DEST$,"___temp_"),TR_CORELMOV_EXE, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELMOV_EXE)
  683.                 RUN( TR_REGLOAD_S + " " + MakePath(DEST$,TR_CONFIG+"\"+"corelmov.reg" ))
  684.         ENDIF
  685.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+TR_CORELMOV_INI), femExists) THEN
  686.                 ini$ = MakePath(DEST$,TR_CONFIG+"\"+TR_CORELMOV_INI)
  687.                     CreateIniKeyValue ini$, "Config", "FilterDir", MakePath(DIR(MAIN),TR_PROGRAMS), cmoOverWrite
  688.                 '' Make the changes for media player installation    
  689.                 ini$ = MakePath(WINDIR$, "system.ini")
  690.                     CopyFile MakePath(WINDIR$, "system.ini"), MakePath(WINDIR$, "system.cor"), cmoOverwrite, 0
  691.                     CreateIniKeyValue ini$, "mci", "CorelMOVE", MakePath(DIR(MAIN),TR_PROGRAMS+"\"+"mcicmv40.drv"), cmoOverWrite
  692.                     CreateIniKeyValue ini$, "drivers", "VIDC.MSVC", "msvidc.drv", cmoOverWrite
  693.                     CreateIniKeyValue TR_WIN_INI, "mci extensions", "cmv", "CorelMOVE", cmoOverWrite
  694.                     CreateIniKeyValue TR_WIN_INI, "mci extensions", "mwf", "CorelMOVE", cmoOverWrite
  695.                 ini$ = MakePath(WINDIR$, "MPLAYER.INI")
  696.                     CopyFile MakePath(WINDIR$, "mplayer.ini"), MakePath(WINDIR$, "mplayer.cor"), cmoOverwrite, 0
  697.                     CreateIniKeyValue ini$, "Devices", "CorelMOVE", "350, CorelMove Player", cmoOverWrite
  698.                 nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELMOVE, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELMOV_EXE), "", cmoOverwrite)
  699.         ENDIF ''DoesFileExist CORELMOV_INI
  700.  
  701.         IF DoesFileExist( MakePath(DEST$, TR_CONFIG+"\"+"coreltrc.ini"), femExists) THEN
  702.             ini$ = MakePath(DEST$,TR_CONFIG+"\"+"coreltrc.ini")
  703.                 CreateIniKeyValue ini$, "Config", "1", MakePath(DEST$, TR_TRACE+"\"+"NORMAL.CTR"), cmoOverWrite
  704.                 CreateIniKeyValue ini$, "Config", "2", MakePath(DEST$, TR_TRACE+"\"+"DITHERED.CTR"), cmoOverWrite
  705.                 CreateIniKeyValue ini$, "Config", "3", MakePath(DEST$, TR_TRACE+"\"+"BIGFORMS.CTR"), cmoOverWrite
  706.             nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELTRACE, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELTRC_EXE), "", cmoOverwrite)
  707.         ENDIF
  708.         
  709.         IF DoesFileExist( MakePath(DIR(MAIN), TR_PROGRAMS+"\"+TR_CORELMOS_EXE), femExists) THEN
  710.             nAddItemFailed% = nAddItemFailed% + CreateProgmanItem( TOOLGROUP$, TR_CORELMOSAIC, MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_CORELMOS_EXE), "", cmoOverwrite)
  711.         ENDIF
  712.         
  713.         UIPop 1 ''WAITCONFIGER Dialog
  714.         
  715.         IF nAddItemFailed% > 0 THEN
  716.             Dialog% = NETADDITEMFAILED
  717.             GOSUB INFO
  718.         ENDIF
  719.         
  720.         ''Let's get the bootable drive, by looking at COMSPEC enviro variable
  721.         TempStr$ = GetEnvVariableValue("COMSPEC")
  722.         ''Assume that config.sys & autoexec.bat are in the same drive as command.com
  723.         Drive$ = MID$ (TempStr$, 1, 1)
  724.         '' If Scanners installed we need to add the lines to config.sys & autoexec.bat
  725.         IF afState(SCANNERS) = SOME THEN
  726.             '$IFDEF DEBUG
  727.                 WriteToLogFile "Drive of Command.com is: " + Drive$
  728.             '$ENDIF
  729.             IF DoesFileExist( MakePath(WINDIR$, TR_TWAIN+"\"+TR_COREL+"\"+"CORTWAIN.INI"), femExists) THEN
  730.                 ini$ = MakePath(WINDIR$,TR_TWAIN+"\"+TR_COREL+"\"+"CORTWAIN.INI")
  731.                 IF bDosScanner% AND GetListLength(AUTOEXECLINE$) THEN
  732.                     CopyFile Drive$+":\"+TR_AUTOEXEC_BAT, Drive$+":\"+TR_AUTOEXEC_COR, cmoOverwrite, 0
  733.                     bAutoexecModified% = TRUE
  734. UPDATEAUTO:
  735.                 WaitOff
  736.                  sz$ = UIStartDlg( "mscuistf.dll", UPDATEAUTOEXEC, "FButtonsDlgProc", UPDATEHELP, "FHelpDlgProc" )
  737.             SELECT CASE sz$
  738.                 CASE "U"
  739.                         UIPop(1)
  740.                         FModifyFile Drive$+":\"+TR_AUTOEXEC_BAT, AUTOEXECLINE$, "E"
  741.                         '$IFDEF DEBUG
  742.                             FOR i% =1 TO GetListLength(AUTOEXECLINE$)
  743.                                 WriteToLogFile "the Autoexec is: "+GetListItem(AUTOEXECLINE$, i%)
  744.                             NEXT i%
  745.                         '$ENDIF
  746.                     CASE "D"
  747.                         UIPop(1)
  748.                         FModifyFile Drive$+":\"+TR_AUTOEXEC_COR, AUTOEXECLINE$, "E"
  749.                     CASE ELSE
  750.                         GOTO UPDATEAUTO
  751.                 END SELECT
  752.                 ENDIF
  753.         
  754.                 IF bDosScanner% AND GetListLength(CONFIGLINE$) THEN
  755.                     CopyFile Drive$+":\"+TR_CONFIG_SYS, Drive$+":\"+TR_CONFIG_COR, cmoOverwrite, 0
  756. UPDATECONFIG:
  757.                     WaitOff
  758.                      sz$ = UIStartDlg( "mscuistf.dll", UPDATECONFIG, "FButtonsDlgProc", UPDATEHELP, "FHelpDlgProc" )
  759.                 SELECT CASE sz$
  760.                     CASE "U"
  761.                             UIPop(1)
  762.                             FModifyFile Drive$+":\"+TR_CONFIG_SYS, CONFIGLINE$, "B"
  763.                             '$IFDEF DEBUG
  764.                                 FOR i% =1 TO GetListLength(CONFIGLINE$)
  765.                                     WriteToLogFile "the Config is: "+GetListItem(CONFIGLINE$, i%)
  766.                                 NEXT i%
  767.                             '$ENDIF
  768. ''                            bConfigUpdated% = TRUE
  769.                         CASE "D"
  770.                             FModifyFile Drive$+":\"+TR_CONFIG_COR, CONFIGLINE$, "B"
  771.                             UIPop(1)
  772.                         CASE ELSE
  773.                             GOTO UPDATECONFIG
  774.                     END SELECT
  775.                 ENDIF
  776.                 IF bDosScanner% THEN
  777.                     CreateIniKeyValue ini$, "ZSTWAIN.DLL", "path", MakePath(szDestScannersDir$, "zstwain.dll"), cmoOverWrite
  778.                 ELSEIF bTwainScanner% THEN
  779.                     CreateIniKeyValue ini$, "CANON", "IPUBJS-SCANNER", MakePath(szDestScannersDir$,"canoncj1.dll"), cmoOverWrite
  780.                 ENDIF
  781.             ENDIF
  782.         ENDIF
  783.         
  784. '' Installing SHARE
  785.         '' We don't want to install SHARE for Windows for Workgroups
  786.         IF bWindowsForWorkgroups% = FALSE THEN
  787.             ShareFile$ = FindFileInTree("SHARE.EXE", Drive$+":\")
  788.                 WriteToLogFile "Found Share in: "+ShareFile$
  789.             IF ShareFile <> "" THEN
  790.                 SetSymbolValue "ShareLine", "{}"
  791.                 AddListItem "ShareLine", ShareFile$+" /L:500 /F:5100"
  792.                 IF bAutoexecModified% = FALSE THEN
  793.                     CopyFile Drive$+":\"+TR_AUTOEXEC_BAT, Drive$+":\"+TR_AUTOEXEC_COR, cmoOverwrite, 0
  794.                 ENDIF
  795. UPDATEAUTOEXECFORSHARE:                
  796.                 WaitOff
  797.                  sz$ = UIStartDlg( "mscuistf.dll", UPDATEAUTOEXECFORSHARE, "FButtonsDlgProc", UPDATEHELP, "FHelpDlgProc" )
  798.             SELECT CASE sz$
  799.                 CASE "U"
  800.                         UIPop(1)
  801.                             FModifyFile Drive$+":\"+TR_AUTOEXEC_BAT, "ShareLine", "E"
  802.                         '$IFDEF DEBUG
  803.                             FOR i% =1 TO GetListLength("ShareLine")
  804.                                 WriteToLogFile "the Config is: "+GetListItem("ShareLine", i%)
  805.                             NEXT i%
  806.                         '$ENDIF
  807.                     CASE "D"
  808.                         FModifyFile Drive$+":\"+TR_AUTOEXEC_COR, "ShareLine", "E"
  809.                         UIPop(1)
  810.                     CASE ELSE
  811.                         GOTO UPDATEAUTOEXECFORSHARE
  812.                 END SELECT
  813.             ENDIF
  814.         ENDIF
  815.         
  816. '' User has completed run of setup or has unconditionally decided to quit
  817. QUIT:
  818.     WaitOff
  819.     '' On MSTest errors report "setup file corrupted" and abort
  820.     ON ERROR GOTO ERRQUIT
  821.  
  822.     IF ERR = 0 THEN
  823.         sz$ = UIStartDlg("mscuistf.dll", SUCCESS, "FSuccessBitmapDlgProc", 0, "")
  824.         IF bInstallWorkstation% THEN
  825.             dlg% = NETEXITSUCCESS
  826.         ELSE
  827.             dlg% = EXITSUCCESS
  828.         ENDIF
  829.         szDlgProc$ = "FInfo075DlgProc"
  830.         WriteToLogfile TR_SETUPSUCCEEDED
  831.     ELSEIF ERR = STFQUIT THEN
  832.         dlg% = EXITQUIT
  833.         szDlgProc$ = "FInfo0DlgProc"
  834.         WriteToLogfile TR_SETUPQUIT
  835.     ELSE
  836.         dlg% = ERROREXITFAILURE
  837.         szDlgProc$ = "FInfo0DlgProc"
  838.         WriteToLogfile TR_SETUPFAILED
  839.     ENDIF
  840.     WriteToLogfile ""
  841.     
  842.  
  843. '' Put up one of the exit message dialog boxes
  844. QUITL1:
  845.     sz$ = UIStartDlg("mscuistf.dll", dlg%, szDlgProc, 0, "")
  846.     IF sz$ = "REACTIVATE" THEN
  847.         GOTO QUITL1
  848.     ENDIF
  849.  GOTO FINISH
  850.  
  851.  
  852. '' An error has occurred in MSTest. Tell the user and abort.
  853. ERRQUIT:
  854.     i% = DoMsgBox( TR_ERRQUIT, TR_SETUPMESSAGE, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  855.     WriteToLogfile TR_SETUPCORRUPTED
  856.     WriteToLogFile ""
  857. FINISH:
  858.     UIPopAll
  859.     ShutDownInstall
  860.     CloseLogFile
  861.     END
  862.  
  863.  
  864. '' allow the user to select all the customize options
  865. CUSTINST:
  866.         '$IFDEF DEBUG
  867.             WriteToLogFile "CUSTINST:"
  868.         '$ENDIF
  869.     bBack% = FALSE
  870.     RemoveSymbol "InstallDirs"
  871.     RemoveSymbol "InstallState"
  872.     '' pass current directories and custom install state to dlgproc
  873.     FOR i%= 1 to NUMCUST
  874.         AddListItem "InstallDirs", " "
  875.         AddListItem "InstallState", NUM(afState(i%))
  876.     NEXT i%
  877.         ReplaceListItem "InstallDirs", SCANNERS, szDestScannersDir$
  878.  
  879.     ''Do a full recalculation if necessary
  880. ''    IF bRecalc% THEN
  881.         WaitOnBig
  882.         bRecalc% = FALSE
  883.         RecalcPath
  884. ''    ENDIF
  885.     
  886. CUSTINSTL2:    
  887.     WaitOn
  888.         '$IFDEF DEBUG
  889.             WriteToLogFile "CUSTINSTL2:"
  890.         '$ENDIF
  891. ''    SetDriveStatus
  892.     
  893. CUSTINSTL22:
  894.         
  895.     SetDriveStatus                '' set DriveText$ and StatusText$
  896.     WaitOff
  897.     
  898.     sz$ = UIStartDlg("mscuistf.dll", CUSTINSTCDBASED, "FCustInstDlgProc", CUSTINSTHELP, "FHelpDlgProc")
  899.     
  900.     
  901.     SELECT CASE sz$
  902.     CASE "CONTINUE"
  903.         WaitOn
  904.         GOSUB SetDirFromSymbol    '' set afState and DIR array from symbols
  905.         IF bBadPath% THEN
  906.             GOTO CUSTINSTL22
  907.         ENDIF
  908.         SetDriveStatus                    '' Test for not enough space
  909.         IF bTooBig% THEN
  910.             Dialog% = TOOBIG
  911.             GOSUB INFO
  912.             GOTO CUSTINSTL22
  913.         ENDIF
  914.         IF afState(FONTTT) = ALL AND bInstallWorkstation% = FALSE THEN
  915.             Dialog% = MOREFONTS
  916.             GOSUB INFO
  917.         ENDIF
  918.         
  919.         WriteToLogFile TR_DIRECTORIES
  920.         WriteToLogFile TR_CUSTOMSELECT
  921.         WriteToLogFile TR_CUSTOMMESSAGE
  922.         WriteToLogFile TR_FILTERS + " - " + STR$(afState(FILTERS)) + " - " + DIR(FILETRS)
  923.         WriteToLogFile TR_TTF + " - " + STR$(afState(FONTTT)) + " - " + DIR(FONTTT)
  924.         WriteToLogFile TR_SCANNERS + " - " + STR$(afState(SCANNERS)) + " - " + DIR(SCANNERS)
  925.         WriteToLogFile TR_ASTERIXES
  926.         
  927.     CASE "CUST8"
  928.         WaitOn
  929.         IF DoesDirExist(DIR(SCANNERS)) THEN
  930.     ''        szOptions$ = OPTS(SCANNERS)
  931.             SelectType% = SCANNERS
  932.             GOSUB SetDirFromSymbol    '' set afState and DIR array from symbols
  933.             IF bBadPath% THEN
  934.                 GOTO CUSTINSTL22
  935.             ENDIF
  936.             FOR i%=1 TO 3
  937.                 AddListItem "StatusText", ""
  938.             NEXT i%
  939.             InitScannerSelection
  940.             bDosScanner% = FALSE
  941.             bTwainScanner% = FALSE
  942.             GOSUB CUSTSCANNERS
  943.             CloseScannerSelection
  944.             RecalcOptFiles SelectType%
  945.         ENDIF
  946.         GOTO CUSTINSTL22
  947.         
  948.     CASE "CUST10"
  949.         WaitOn
  950.         IF DoesDirExist(DIR(FONTTT)) THEN
  951.             SelectType% = FONTTT
  952.             IF bInstallWorkstation% THEN
  953.                 Dialog% = SELECTFONTTT
  954.             ELSE
  955.                 Dialog% = SELECTFONTTTCD
  956.             ENDIF
  957.                 szFList1a$ = FONTLIST1$
  958.                 szFList1b$ = FONTLIST2$
  959. ''                RecalcOptFiles SelectType%
  960.                 GOSUB SELECTFILES
  961.                 szFList1a$ = ""
  962.                 szFList1b$ = ""
  963.         ENDIF
  964.         GOTO CUSTINSTL22
  965.         
  966.     ''reset afState, the drive status and status text
  967.     CASE "RESET"
  968.         WaitOn
  969.         GOSUB SetDirFromSymbol    '' set afState and DIR array from symbols
  970.         bRecalc% = TRUE
  971.         GOTO CUSTINSTL22
  972.         
  973.     CASE "REACTIVATE"
  974.         GOSUB SetDirFromSymbol    '' set afState and DIR array from symbols
  975.         bRecalc% = TRUE
  976.         GOTO CUSTINSTL22
  977.         
  978.     CASE "CANCEL", "BACK"
  979.         WaitOn
  980.         bBack% = TRUE
  981.         
  982.     CASE ELSE
  983.         GOSUB ASKQUIT
  984.         GOSUB SetDirFromSymbol    '' set afState and DIR array from symbols
  985.         GOTO CUSTINSTL22
  986.     END SELECT
  987.     UIPop 1
  988.     RETURN    '' The work needed is done, let's install the files.
  989.     
  990. '' Don't ask what progman group to use if installing as an administrator
  991. '' Since the group selection is deleted, we don't need to jump anything: 16Apr93
  992.  
  993. CUSTSCANNERS:
  994.          AddListItem "CombosStatus", GetListItem("ScanList", 1)
  995.         IF GetListLength("OptionList") THEN
  996.              AddListItem "CombosStatus", GetListItem("OptionList", 1)
  997.         ELSE
  998.              AddListItem "CombosStatus", ""
  999.         ENDIF
  1000.         IF GetListLength("SubOptionList") THEN
  1001.              AddListItem "CombosStatus", GetListItem("SubOptionList", 1)
  1002.         ELSE
  1003.              AddListItem "CombosStatus", ""
  1004.         ENDIF
  1005.         bDosScanner% = 0
  1006.         bTwainScanner% = 0
  1007.             
  1008. CUSTSCANNERS2:
  1009.     WaitOff
  1010.     
  1011.  
  1012.     sz$ = UIStartDlg("mscuistf.dll", CUSTSCAN, "FScannerDlgProc", CUSTSCANHELP, "FHelpDlgProc")
  1013.  
  1014.  
  1015.     SELECT CASE sz$
  1016.     CASE "CONTINUE"
  1017.         SetSymbolValue SCANNERSECTION, "{}"
  1018.         SetSymbolValue CONFIGLINE, "{}"
  1019.         SetSymbolValue AUTOEXECLINE, "{}"
  1020.         bDosScanner% = FGetScannerLine(szDestScannersDir$+"\")
  1021.         bTwainScanner% = NOT bDosScanner%
  1022.         IF afState(SCANNERS) <> SOME THEN
  1023.             afState(SCANNERS) = SOME  
  1024.         ENDIF
  1025.         WaitOn
  1026.         GOSUB SetDirFromSymbol    
  1027.         RecalcOptFiles SCANNERS
  1028.     
  1029.     CASE "COMBO1"
  1030.         GOTO CUSTSCANNERS2
  1031.     CASE "COMBO2"
  1032.         GOTO CUSTSCANNERS2
  1033.     CASE "COMBO3"
  1034.         GOTO CUSTSCANNERS2
  1035.         
  1036.     CASE "REACTIVATE"
  1037.         GOTO CUSTSCANNERS2
  1038.         
  1039.     CASE "CANCEL"
  1040.         UIPop 1
  1041.         RETURN
  1042.             
  1043.     CASE ELSE
  1044.         GOSUB ASKQUIT
  1045.         GOTO CUSTSCANNERS2
  1046.         
  1047.     END SELECT
  1048.     UIPop 1
  1049. RETURN
  1050.  
  1051. '' Display an information dialog
  1052. '' Uses the global Dialog% to identify which dialog to display
  1053. INFO:
  1054.     WaitOff
  1055.     sz$ = UIStartDlg( "mscuistf.dll", Dialog%, "FInfo0DlgProc", 0, "" )
  1056.     SELECT CASE sz$
  1057.     CASE "CONTINUE"
  1058.         ''Do nothing
  1059.     CASE "REACTIVATE"
  1060.         bRecalc% = TRUE
  1061.         GOTO INFO
  1062.     CASE "EXIT"
  1063.         GOSUB ASKQUIT
  1064.         GOTO INFO
  1065.     END SELECT
  1066.     UIPop 1
  1067. RETURN
  1068.  
  1069. '' Get the base directory under which CorelDRAW! will be installed
  1070. GETPATH:
  1071.     bBack% = FALSE
  1072.         '$IFDEF DEBUG
  1073.             WriteToLogFile "GETPATH:"
  1074.         '$ENDIF
  1075.     bRet% = FIsDrawExist(TR_WIN_INI, szString$)
  1076.     WriteToLogFile "FIsDrawExist returns: "+STR$(bRet%)
  1077.     IF bRet% THEN  '' We have DRAW installed before (could be DRAW3 or DRAW4)
  1078.         DEST$ = szString$
  1079.     ENDIF
  1080.     Dialog% = DESTPATH
  1081.     SetSymbolValue "EditTextIn", DEST$
  1082.     SetSymbolValue "EditFocus", "END"
  1083. GETPATHL1:
  1084.     WaitOff
  1085.         '$IFDEF DEBUG
  1086.             WriteToLogFile "GETPATHL1:"
  1087.         '$ENDIF
  1088.     sz$ = UIStartDlg("mscuistf.dll", Dialog%, "FEditDlgProc", DESTPATHHELP, "FHelpDlgProc")
  1089.     SELECT CASE sz$
  1090.     CASE "CONTINUE"
  1091.         WaitOn
  1092.         olddest$ = DEST$
  1093.         DEST$ = RTRIM$(LTRIM$(GetSymbolValue("EditTextOut")))
  1094.         ''Validate new path.
  1095.         IF DEST$ = "" OR IsDirWritable(DEST$) = 0 THEN
  1096.             OldDialog% = Dialog%
  1097.             Dialog% = ERRORBADPATH
  1098.             GOSUB INFO
  1099.             Dialog% = OldDialog%
  1100.             GOTO GETPATHL1
  1101.         ENDIF
  1102.  
  1103.         ''Set Recalc and change subdirectories if DEST$ changed
  1104.         IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  1105.             bRecalc% = TRUE
  1106.         ENDIF
  1107.         
  1108.     CASE "REACTIVATE"
  1109.         bRecalc% = TRUE
  1110.         GOTO GETPATHL1
  1111.     CASE "CANCEL", "BACK"
  1112.         UIPop 1
  1113.         bBack% = TRUE
  1114.         RETURN
  1115.     CASE ELSE
  1116.         GOSUB ASKQUIT
  1117.         GOTO GETPATHL1
  1118.     END SELECT
  1119.     WriteToLogFile TR_BASEDIR + DEST$
  1120.     WriteToLogFile ""
  1121.     UIPop 1
  1122. RETURN
  1123.  
  1124.  
  1125. '' The user has asked to quit - confirm his decision
  1126. ASKQUIT:
  1127.     WaitOff
  1128.     sz$ = UIStartDlg("mscuistf.dll", ASKQUIT, "FQuitDlgProc", 0, "")
  1129.     SELECT CASE sz$
  1130.     CASE "EXIT"
  1131. ''        GOTO FINISH
  1132. ''        UIPopAll
  1133.         ERROR STFQUIT
  1134.     CASE "REACTIVATE"
  1135.         bRecalc% = TRUE
  1136.         GOTO ASKQUIT
  1137.     CASE ELSE
  1138.         ''Do nothing
  1139.     END SELECT
  1140.     UIPop 1
  1141. RETURN
  1142.  
  1143.  
  1144. '' Permit the user to select which filters or fonts/symbols he wants to install
  1145. SELECTFILES:
  1146.     '$IFDEF DEBUG
  1147.         WriteToLogFile "SELECTFILES:"
  1148.     '$ENDIF
  1149.     SetSymbolValue "ListItems1a", GetSymbolValue( szFList1a$ )
  1150.     SetSymbolValue "ListItems1b", GetSymbolValue( szFList1b$ )
  1151.  
  1152. SELECTL1:
  1153.     '$IFDEF DEBUG
  1154.         WriteToLogFile "SELECTL1:"
  1155.     '$ENDIF
  1156.     WaitOff
  1157.     sz$ = UIStartDlg("mscuistf.dll", Dialog%, "FList4DlgProc", SELECTHELP, "FHelpDlgProc")
  1158.     
  1159.     SELECT CASE sz$
  1160.     CASE "CONTINUE"
  1161.         WaitOn
  1162.         ''If lists have been modified, reset them and recalculate
  1163.         newlist$ = GetSymbolValue( "ListItems1a" )
  1164.         IF newlist$ <> GetSymbolValue( szFList1a$ ) THEN
  1165.             IF newlist$ = "" THEN
  1166.                 SetSymbolValue szFList1a$, "{}"
  1167.             ELSE
  1168.                 SetSymbolValue szFList1a$, newlist$
  1169.             ENDIF
  1170.             newlist$ = GetSymbolValue( "ListItems1b" )
  1171.             IF newlist$ = "" THEN
  1172.                 SetSymbolValue szFList1b$, "{}"
  1173.             ELSE
  1174.                 SetSymbolValue szFList1b$, newlist$
  1175.             ENDIF
  1176.             bRecalcOpt = TRUE
  1177.         ENDIF
  1178.         UIPop 1
  1179. ''        IF SelectType% = FONTSYM OR SelectType% = FONTTT AND bRecalcOpt% THEN
  1180.             WaitOnBig
  1181.             RecalcOptFiles SelectType%
  1182. ''        ENDIF
  1183. ''        newlist$ = ""
  1184.     CASE "REACTIVATE"
  1185.         bRecalc% = TRUE
  1186.         GOTO SELECTL1
  1187.     CASE "CANCEL", "BACK"
  1188.         UIPop 1
  1189.         IF SelectType% = FONTSYM OR SelectType% = FONTTT THEN
  1190.             WaitOnBig
  1191.             RecalcOptFiles SelectType%
  1192.         ENDIF
  1193.     CASE ELSE
  1194.         GOSUB ASKQUIT
  1195.         GOTO SELECTL1
  1196.     END SELECT
  1197.     RemoveSymbol "ListItems1a"
  1198.     RemoveSymbol "ListItems1b"
  1199.     RemoveSymbol "ListItems2a"
  1200.     RemoveSymbol "ListItems2b"
  1201. RETURN
  1202.  
  1203. '' $Keywords: draw2.mst 2.22 15Oct92 11:43am$ $nokeywords$
  1204. '**
  1205. '** Purpose:
  1206. '**     Adds the specified option files to the copy list.
  1207. '** Arguments:
  1208. '**     ftype%  - type of files to add, one of the following:
  1209. '**             DRAW, CHART, SHOW, PHOTO, MOVE, TRACE, MOSAIC, FILTERS or FONTTT
  1210. '** Returns:
  1211. '**     none.
  1212. '*************************************************************************
  1213. SUB AddOptFilesToCopyList (ftype%) STATIC
  1214.  
  1215.     '$IFDEF DEBUG
  1216.         WriteToLogFile "SUB AddOptFilesToCopyList " + STR$(ftype%)
  1217.     '$ENDIF
  1218.     fState% = afState(ftype%)
  1219.         
  1220.     SELECT CASE ftype%
  1221.     CASE DRAW
  1222.             TestAddSectionFilesToCopyList "DrawDraw", DIR(DRAW), MakePath(DEST$, TR_DRAW)
  1223.             TestAddSectionFilesToCopyList "DrawConfig", MakePath(DIR(MAIN), TR_CONFIG), MakePath(DEST$,TR_CONFIG)
  1224.             
  1225.     CASE CHART
  1226.             TestAddSectionFilesToCopyList "ChartConfig", MakePath(DIR(MAIN), TR_CONFIG), MakePath(DEST$,TR_CONFIG)
  1227.             
  1228.     CASE SHOW
  1229.             TestAddSectionFilesToCopyList "ShowConfig", MakePath(DIR(MAIN), TR_CONFIG), MakePath(DEST$,TR_CONFIG)
  1230.             IF bWindowsIsNetworked% = FALSE OR DoesFileExist( MakePath(WINSYSDIR$,"qtnotify.exe"), femExists ) = 0 THEN 
  1231.                 TestAddSectionFilesToCopyList "ShowRedist", MakePath(DIR(MAIN), TR_REDIST), szWWinDir$
  1232.             ENDIF
  1233.             TestAddSectionFilesToCopyList "ShowRedistWin", MakePath(DIR(MAIN), TR_REDIST), WINDIR$
  1234.             
  1235.     CASE PHOTO
  1236.             TestAddSectionFilesToCopyList "PhotoConfig", MakePath(DIR(MAIN), TR_CONFIG), MakePath(DEST$,TR_CONFIG)
  1237.             TestAddSectionFilesToCopyList "PhotoColors", MakePath(DIR(PHOTO), TR_COLORS), MakePath(DEST$, TR_PHOTOPNT+"\"+TR_COLORS)
  1238.             
  1239.     CASE MOVE
  1240.             TestAddSectionFilesToCopyList "MoveConfig", MakePath(DIR(MAIN), TR_CONFIG), MakePath(DEST$,TR_CONFIG)
  1241.             IF bWindowsIsNetworked% = FALSE OR DoesFileExist( MakePath(WINSYSDIR$,"dib.drv"), femExists ) = 0 THEN 
  1242.                 TestAddSectionFilesToCopyList "MoveRedist", MakePath(DIR(MAIN), TR_REDIST), szWWinDir$
  1243.             ENDIF
  1244.             TestAddSectionFilesToCopyList "MoveRedistWin", MakePath(DIR(MAIN), TR_REDIST), WINDIR$
  1245.  
  1246.     CASE TRACE
  1247.             TestAddSectionFilesToCopyList "TraceConfig", MakePath(DIR(MAIN), TR_CONFIG), MakePath(DEST$,TR_CONFIG)
  1248.             TestAddSectionFilesToCopyList "TraceTrace", DIR(TRACE), MakePath(DEST$, TR_TRACE)
  1249.             
  1250.     CASE MOSAIC
  1251.             IF bWindowsIsNetworked% = FALSE OR DoesFileExist( MakePath(WINSYSDIR$,"pcdxbmp.dll"), femExists ) = 0 THEN 
  1252.                 TestAddSectionFilesToCopyList "MosaicRedist", MakePath(DIR(MAIN), TR_REDIST), szWWinDir$
  1253.             ENDIF
  1254.             
  1255.     CASE FILTERS
  1256.             IF bWindowsIsNetworked% = FALSE OR DoesFileExist( MakePath(WINSYSDIR$,"pcdlib.dll"), femExists ) = 0 THEN 
  1257.                 TestAddSectionFilesToCopyList "ImpKodak Photo-CD", MakePath(DIR(MAIN), TR_REDIST), szWWinDir$ 
  1258.             ENDIF
  1259.             
  1260.     CASE FONTTT
  1261.             
  1262.     CASE SCANNERS
  1263.         IF fState% <> NONE THEN
  1264.             IF fstate% = SOME THEN
  1265.                 TestAddSectionFilesToCopyList "Twain", MakePath(DIR(MAIN), TR_REDIST), WINDIR$
  1266.                 TestAddSectionFilesToCopyList "TwainScan", DIR(SCANNERS), MakePath(WINDIR$, TR_TWAIN+"\"+TR_COREL)
  1267.                 WriteToLogFile "Added TwainScan: szDestScannersDir = " + szDestScannersDir$
  1268.                 IF bDosScanner% THEN
  1269.                     TestAddSectionFilesToCopyList "ZSTwainScan", DIR(SCANNERS), szDestScannersDir$ 
  1270.                     Section$ = GetListItem(SCANNERSECTION$, 1)
  1271.                     TestAddSectionFilesToCopyList Section$, DIR(SCANNERS), szDestScannersDir$ 
  1272.                 ENDIF
  1273.                 IF bTwainScanner% THEN
  1274.                     Section$ = GetListItem(SCANNERSECTION$, 1)
  1275.                     TestAddSectionFilesToCopyList Section$, DIR(SCANNERS), szDestScannersDir$ 
  1276.                 ENDIF
  1277.             ENDIF
  1278.         ENDIF
  1279.             
  1280.          
  1281.     CASE MAIN
  1282.         
  1283.             '' So we have an App to install, so we can create the main directory
  1284. ''''''''' The following section has been commented
  1285. ''''''''' We'll not copy Readme.wri to the user harddisk, but if it exist
  1286. ''''''''' we'll create teh icon and point to it.                
  1287. ''        IF bInstallWorkstation% THEN
  1288. ''            TestAddSectionFilesToCopyList "Main", DIR(MAIN), DEST$
  1289. ''        ENDIF
  1290.  
  1291.         TestAddSectionFilesToCopyList "CommonConfig", MakePath(DIR(MAIN), TR_CONFIG), MakePath(DEST$,TR_CONFIG)
  1292.         TestAddSectionFilesToCopyList "Custom", MakePath(DIR(MAIN), TR_CUSTOM), MakePath(DEST$,TR_CUSTOM)
  1293.         TestAddSectionFilesToCopyList "AgraphixAgraphix", MakePath(DIR(MAIN),TR_AGRAPHIX), MakePath(DEST$,TR_AGRAPHIX)
  1294.         TestAddSectionFilesToCopyList "AgraphixPrinters", MakePath(DIR(MAIN),TR_AGRAPHIX+"\"+TR_PRINTERS), MakePath(DEST$,TR_AGRAPHIX+"\"+TR_PRINTERS)
  1295.         TestAddSectionFilesToCopyList "AgraphixToagx", MakePath(DIR(MAIN),TR_AGRAPHIX+"\"+TR_TOAGX), MakePath(DEST$,TR_AGRAPHIX+"\"+TR_TOAGX)
  1296.         TestAddSectionFilesToCopyList "WFN", szSymbolDir$, MakePath(DEST$,TR_SYMBOLS)
  1297.             
  1298.         IF bInstallWorkstation% THEN
  1299.             IF bWindowsIsNetworked% = FALSE OR DoesFileExist( MakePath(WINSYSDIR$,"ole2.dll"), femExists ) = 0 THEN 
  1300.                 TestAddSectionFilesToCopyList "CommonRedist", MakePath(DIR(MAIN), TR_REDIST), szWWinDir$
  1301.             ENDIF
  1302.         ELSE
  1303.             TestAddSectionFilesToCopyList "CommonRedist", MakePath(DIR(MAIN), TR_REDIST), szWWinDir$
  1304.         ENDIF
  1305.         
  1306.     END SELECT
  1307.     
  1308. END SUB
  1309.  
  1310. '**
  1311. '** Purpose:
  1312. '**     Recalculates disk space for the given option files and sets
  1313. '**     the status info symbol "StatusItemsText".
  1314. '** Arguments:
  1315. '**     ftype% - type of files to add, one of the following:
  1316. '**       DRAW, CHART, SHOW, PHOTO, MOVE, TRACE, MOSAIC, FILTERS, FONTTT, MAIN
  1317. '** Returns:
  1318. '**     none.
  1319. '*************************************************************************
  1320. SUB RecalcOptFiles (ftype%) STATIC
  1321.         '$IFDEF DEBUG
  1322.             WriteToLogFile "SUB RecalcOptFiles"
  1323.         '$ENDIF
  1324.     ClearCopyList
  1325.     AddOptFilesToCopyList ftype%
  1326.     
  1327.     FRecalcOptFiles ftype%, aszNEEDS(ftype%)
  1328.         
  1329. END SUB
  1330.  
  1331.  
  1332. '**
  1333. '** Purpose:
  1334. '**     Recalculates disk space and sets option status info according
  1335. '**     to the current destination path.
  1336. '** Arguments: Type%: Passed to RecalcGroup
  1337. '**     none.
  1338. '** Returns:
  1339. '**     none.
  1340. '*************************************************************************
  1341. SUB RecalcPath STATIC
  1342.  
  1343.         '$IFDEF DEBUG
  1344.             WriteToLogFile "SUB RecalcPath"
  1345.         '$ENDIF
  1346.     
  1347.     FOR i% = 1 TO NUMGROUPS STEP 1
  1348.         RecalcOptFiles i%
  1349.     NEXT i%
  1350. END SUB
  1351.  
  1352.  
  1353. '**
  1354. '** Purpose:
  1355. '**     Sets drive status info according to latest disk space calcs.
  1356. '**     Checks that enough space is available on all drives.
  1357. '** Arguments:
  1358. '**     none.
  1359. '** Returns:
  1360. '**     none.
  1361. '*************************************************************************
  1362. SUB SetDriveStatus STATIC
  1363.     
  1364.     '$IFDEF DEBUG
  1365.         WriteToLogFile "SUB SetDriveStatus"
  1366.     '$ENDIF
  1367.     DIM alCosts AS POINTER TO LONG
  1368.     NoOfDrives% = GetListLength(DrivesList$)    
  1369.     ALLOCATE alCosts, NoOfDrives%
  1370.     
  1371.     ''Calculate total costs for each drive
  1372.     FOR i% = 0 TO NoOfDrives%-1 STEP 1
  1373.         alCosts[i%] = 0
  1374.     NEXT i%
  1375.     
  1376.     FOR i% = 0 TO NoOfDrives%-1
  1377.         ndrive% = ASC(GetListItem(DrivesList$, i%+1)) - ASC("A") 
  1378.         FOR j%= 1 TO NUMGROUPS
  1379.             alCosts[i%] = alCosts[i%] + VAL(GetListItem(aszNEEDS(j%), ndrive%+1))
  1380.         NEXT j%
  1381.     NEXT i%
  1382.     
  1383.     ''Store the costs and free space for the first five drives used
  1384.     j% = 0
  1385.     bTooBig% = FALSE
  1386.     FOR i% = 0 TO NoOfDrives%-1 STEP 1
  1387.         if alCosts[i%] > 0 THEN
  1388.             j% = j% + 1
  1389.             drive$ = GetListItem(DrivesList$, i%+1) 
  1390.             free& = GetFreeSpaceForDrive(drive$)
  1391.             IF free& < alCosts[i%] THEN
  1392.                 bTooBig% = TRUE
  1393.             ENDIF
  1394.             IF j% < 6 THEN
  1395.                 ReplaceListItem DRIVETEXT$, j%*3-2, drive$ + ":"
  1396.                 ReplaceListItem DRIVETEXT$, j%*3-1, STR$(alCosts[i%] / 1024) + " K"
  1397.                 ReplaceListItem DRIVETEXT$, j%*3, STR$(free& / 1024) + " K"
  1398.             ENDIF
  1399.             drive=""
  1400.         ENDIF
  1401.     NEXT i%
  1402.     ''wipe clean all remaining directory information
  1403.     FOR i% = j%*3+1 TO 15 STEP 1
  1404.         ReplaceListItem DRIVETEXT$, i%, ""
  1405.     NEXT i%
  1406.     DEALLOCATE alCosts
  1407.  
  1408. END SUB
  1409.  
  1410.  
  1411. '**
  1412. '** Purpose:
  1413. '**     Removes the optional trailing "\"
  1414. '** Arguments:
  1415. '**     szDir$  - full directory path (with optional ending "\")
  1416. '** Returns:
  1417. '**     szDir$ without a trailing "\"
  1418. '*************************************************************************
  1419. FUNCTION MakeDir (szDir$) STATIC AS STRING
  1420.     IF szDir$ <> "" THEN
  1421.         IF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  1422.             MakeDir = MID$( szDir$, 1, LEN(szDir$) - 1 )
  1423.         ELSE
  1424.             MakeDir = szDir$
  1425.         ENDIF
  1426.     ELSE
  1427.         MakeDir = szDir$
  1428.     ENDIF
  1429. END FUNCTION
  1430.  
  1431.  
  1432. '**
  1433. '** Purpose:
  1434. '**     Appends a file name to the end of a directory path,
  1435. '**     inserting a backslash character as needed.
  1436. '** Arguments:
  1437. '**     szDir$  - full directory path (with optional ending "\")
  1438. '**     szFile$ - filename to append to directory
  1439. '** Returns:
  1440. '**     Resulting fully qualified path name.
  1441. '*************************************************************************
  1442. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  1443.     MakePath = MakeDir(szDir$) + "\" + szFile$
  1444. END FUNCTION
  1445.  
  1446.  
  1447. '** This sub converts the symbol "InstallDirs" into the DIR array
  1448. '** and the symbol "InstallState" into the afState array, 
  1449. '** recalculating disk usage if anything has changed.
  1450. '** NOTE: this a only a simulated subroutine because we want to be
  1451. '**       able to GOSUB BADPATH from inside it.
  1452. '*************************************************************************
  1453. SetDirFromSymbol:
  1454.         '$IFDEF DEBUG
  1455.             WriteToLogFile "SetDirFromSymbol:"    
  1456.         '$ENDIF
  1457.     '' Convert "InstallState" into the afState array
  1458.     bRecalcMain% = FALSE
  1459.     FOR i% = SCANNERS TO FONTTT
  1460.         WriteToLogFile "SetDirFromSymbol: Status of "+STR$(i%)
  1461.         WriteToLogFile "with InstallState of: "+GetListItem("InstallState", i%)
  1462.         fNewState% = ASC( GetListItem("InstallState", i%) ) - ASC("1") + 1
  1463.         WriteToLogFile "fNewState% is: "+ STR$(fNewState)
  1464.         IF fNewState% <> afState(i%) THEN
  1465.             afState(i%) = fNewState%
  1466.             WriteToLogFile "State is: "+STR$(afState(i%))
  1467.             RecalcOptFiles i%
  1468.         ENDIF
  1469.     NEXT i%
  1470.     
  1471.     '' Convert "InstallDir" into the DIR array
  1472.         WriteToLogFile "Testing Directory changes"
  1473.         szList$ = "InstallDirs"
  1474.         bBadPath% = FALSE
  1475.             szDir$ = MakeDir(GetListItem(szList$, SCANNERS))
  1476.             WriteToLogFile "szDir$ of scanners: "+szDir$
  1477.             '' If the directory is not writable, tell the user and don't update it.
  1478.             IF szDir$ = "" OR IsDirWritable( szDir$ ) = 0 THEN
  1479.                 WriteToLogFile "Directory has a problem: "+ szDir$
  1480.                 Dialog% = ERRORBADPATH
  1481.                 GOSUB INFO
  1482.                 bBadPath% = TRUE
  1483.                 RETURN
  1484.             ENDIF
  1485.             '' If the directory has changed - recalculate disk usage
  1486.             IF szDestScannersDir$ <> szDir$ THEN
  1487.                 szDestScannersDir$ = szDir$
  1488.                 RecalcOptFiles SCANNERS
  1489.             ENDIF
  1490.             WriteToLogFile "EndOf Subroutine.....SetDirFromSymbol"
  1491.     szDir$ = ""
  1492.     szList$ = ""
  1493. RETURN
  1494.  
  1495. '** This sub sets all files to load - sets directory structure to default
  1496. '*************************************************************************
  1497. SUB PrepInstall STATIC
  1498.  
  1499.     
  1500.     ''Set all sections to install
  1501.     FOR i% = DRAW TO NUMGROUPS
  1502.         afState(i%) = ALL
  1503.     NEXT i%
  1504.         afState(SCANNERS) = NONE
  1505.  
  1506.     SetSymbolValue FONTLIST1$, "{}"
  1507.     MakeFontList
  1508. END SUB
  1509.  
  1510.  
  1511. '** Set the subdirectories to their default values.
  1512. '*************************************************************************
  1513. SUB SetDirectories STATIC
  1514.     '$IFDEF DEBUG
  1515.         WriteToLogFile "SUB SetDirectories"
  1516.     '$ENDIF
  1517.     Drive$ = ""
  1518.     ini$ = MakePath( SrcDir$, TR_SETUP_INI )
  1519.     DIR(MAIN)         = GetIniKeyString( ini$, "Directories", TR_MAIN )
  1520.     DIR(DRAW)         = GetIniKeyString( ini$, "Directories", TR_DRAW )
  1521.     DIR(CHART)         = GetIniKeyString( ini$, "Directories", TR_CHART )
  1522.     DIR(SHOW)         = GetIniKeyString( ini$, "Directories", TR_SHOW )
  1523.     DIR(PHOTO)         = GetIniKeyString( ini$, "Directories", TR_PHOTOPNT )
  1524.     DIR(MOVE)         = GetIniKeyString( ini$, "Directories", TR_MOVE )
  1525.     DIR(TRACE)         = GetIniKeyString( ini$, "Directories", TR_TRACE )
  1526.     DIR(MOSAIC)     = GetIniKeyString( ini$, "Directories", TR_MOSAIC )
  1527.     szSymbolDir$  = GetIniKeyString( ini$, "Directories", TR_WFN )
  1528.     DIR(SCANNERS)    = GetIniKeyString( ini$, "Directories", TR_SCANNERS )
  1529.     szDestScannersDir$ = MakePath(WINDIR$,TR_TWAIN+"\"+TR_COREL)
  1530.     DIR(FILTERS)     = MakePath( DIR(MAIN), TR_PROGRAMS )
  1531.     DIR(FONTTT)     = GetIniKeyString( ini$, "Directories", TR_TTF )
  1532.     
  1533.     KeyVal$ = GetIniKeyString( ini$, "Directories", TR_FIXEDDRIVE )
  1534.     IF KeyVal$ = "CDROM" THEN
  1535.         bInstallWorkstation% = FALSE
  1536.         FOR i% = DRAW TO MAIN STEP 1
  1537.             DIR(i%) = MID$( ini$, 1, 1) + ":\" + DIR(i%)
  1538.             WriteToLogFile "Dir of " + STR$(i%) + " " + DIR(i%)
  1539.         NEXT i%
  1540.         szSymbolDir$ = MID$( ini$, 1, 1)+ ":\" + szSymbolDir$
  1541.     ELSE
  1542.         bInstallWorkstation% = TRUE
  1543.     ENDIF    
  1544.     IF KeyVal$ = "FALSE"  THEN
  1545.             FOR i% = DRAW TO MAIN 
  1546.                 DIR(i%) = MID$( ini$, 1, 1) + MID$( DIR(i%), 2, LEN(DIR(i%))-1 )
  1547.                 WriteToLogFile "Dir of " + STR$(i%) + " " + DIR(i%)
  1548.             NEXT i%
  1549.             szSymbolDir$ = MID$( ini$, 1, 1) + MID$( szSymbolDir$, 2, LEN(szSymbolDir$)-1 )
  1550.     ENDIF
  1551.     IF bInstallWorkstation% THEN
  1552.         szUserName$    = GetIniKeyString( ini$, "Registration", "UserName" )
  1553.         szSerialNumber$    = GetIniKeyString( ini$, "Registration", "SerialNumber" )
  1554.     ENDIF
  1555.     
  1556. END SUB
  1557.  
  1558.  
  1559. '** Make sure that the long wait dialog is displayed and the hourglass cursor
  1560. '** are being used
  1561. '*************************************************************************
  1562. SUB WaitOnBig STATIC
  1563.     IF nWaiting% = 0 THEN
  1564.         CursorSave% = ShowWaitCursor()
  1565.     ENDIF
  1566.     IF nWaiting% <> 2 THEN
  1567.         sz$ = UIStartDlg("mscuistf.dll", WAIT, "FModelessDlgProc", 0, "")
  1568.     ENDIF
  1569.     nWaiting% = 2
  1570. END SUB
  1571.  
  1572.  
  1573. '** Make sure that the hourglass cursor is being used
  1574. '*************************************************************************
  1575. SUB WaitOn STATIC
  1576.     IF nWaiting% = 0 THEN
  1577.         CursorSave% = ShowWaitCursor()
  1578.         nWaiting% = 1
  1579.     ENDIF
  1580. END SUB
  1581.  
  1582.  
  1583. '** Remove the long wait dialog if it is being displayed and reset the cursor
  1584. '** back to normal if it was set to the hourglass icon
  1585. '*************************************************************************
  1586. SUB WaitOff STATIC
  1587.     IF nWaiting% = 2 THEN
  1588.         UIPop 1
  1589.     ENDIF
  1590.     IF nWaiting% <> 0 THEN
  1591.         RestoreCursor CursorSave%
  1592.     ENDIF
  1593.     nWaiting% = 0
  1594. END SUB
  1595.  
  1596.  
  1597. '** Wrapper function - should reduce size of code segment.
  1598. '**
  1599. '** FileChangeString replaces szString1$ in szFile1$ with szString2$.
  1600. '** szFile2$ is a temporary file name.
  1601. '*************************************************************************
  1602. SUB    WrapFileChangeString( szFile1$, szFile2$, szString1$, szString2$ ) STATIC
  1603.     FileChangeString szFile1$, szFile2$, szString1$, szString2$
  1604. END SUB
  1605.  
  1606.  
  1607. '** Wrapper function - should reduce size of code segment.
  1608. '**
  1609. '** CommentIniSection checks to see whether or not the files mentioned in
  1610. '** szSection$ can be found in directory szPath$. If not, it sticks a ';'
  1611. '** in front of that line of the ini file. Otherwise it makes sure there
  1612. '** is not semi-colon commenting out that line.
  1613. '** Note: this function is heavily dependent on the format of coreldrw.ini
  1614. '*************************************************************************
  1615. SUB    WrapCommentIniSection( szFileName$, szTempFile$, szSection$, szPath$ ) STATIC
  1616.     CommentIniSection szFileName$, szTempFile$, szSection$, szPath$
  1617. END SUB
  1618.  
  1619.  
  1620. '** If the second file does not exist, backup szFile1$ as szFile2$
  1621. '*************************************************************************
  1622. SUB CheckBackupFile( szFile1$, szFile2$ ) STATIC
  1623.     IF DoesFileExist(szFile2$,femExists) = 0 AND DoesFileExist(szFile1$,femExists) THEN
  1624.         CopyFile szFile1$, szFile2$, cmoNone, 0
  1625.     ENDIF
  1626. END SUB
  1627.  
  1628. '*************************************************************************
  1629. FUNCTION CreateProgmanItem (szGroup$, szItem$, szCmd$, szOther$, cmo%) STATIC AS INTEGER
  1630.   szItemNew$ = szItem$
  1631.   IF szOther$ <> "" THEN
  1632.     szItemNew$ = szItem$ + "," + szOther$
  1633.   END IF
  1634.  
  1635.   IF FCreateProgManItem(szGroup$, szItemNew$, szCmd$, cmo%) = 0 THEN
  1636.         CreateProgmanItem = 1
  1637.     ELSE
  1638.         CreateProgmanItem = 0
  1639.   END IF
  1640.     szItemNew$ = ""
  1641. END FUNCTION
  1642.  
  1643.  
  1644. '** This sub Add fonts to the user choice list, if he didn't choose the group.
  1645. '** It add the fonts which will not be installed by the unsellected list
  1646. '*************************************************************************
  1647. SUB MakeFontList STATIC
  1648.     
  1649.      WriteToLogFile "SUB MakeFontList"
  1650.     SetSymbolValue FONTLIST2$, "{}"
  1651.             FOR i% = 1 TO GetListLength(szFontSectDisk$)
  1652.                     AddFilesToList GetListItem(szFontSectDisk$, i%), "FON"
  1653.             NEXT i%
  1654.             
  1655. END SUB
  1656.  
  1657.  
  1658. '***********************************************************************
  1659. '***********************************************************************
  1660. '**** Add Filters in Section to the Fileters List
  1661. '***********************************************************************
  1662. SUB AddFilesToList (SectionName$, FiltersList$) STATIC
  1663.         FAddFilesToList SectionName$, FiltersList$
  1664. END SUB
  1665.  
  1666. '***********************************************************************
  1667. '***********************************************************************
  1668. '**** Add Filter (If Exist in Section) to copy list ********************
  1669. '***********************************************************************
  1670. SUB AddFileToCopyList(AppendSect$, Section$, FilterName$) STATIC
  1671.         Destination$ = DIR(FILTERS)
  1672. ''        IF Section$ = "ImpKodak Photo-CD" THEN
  1673. ''            Destination$ = WINSYSDIR$
  1674. ''        ELSE
  1675. ''            IF Section$ = "ExpAdobe Illustrator" OR Section$ = "ExpAutoCAD DXF" Then
  1676. ''                Destination$ = MakePath(DIR(MAIN),TR_PROGRAMS+"\"+TR_DATA)
  1677. ''            ENDIF
  1678. ''        ENDIF
  1679.         '$IFDEF DEBUG
  1680.             WriteToLogFile "Section: "+Section$+"  FilterName: "+FilterName$+"  Destination: "+Destination$
  1681.         '$ENDIF
  1682.         FAddFileToCopyList AppendSect$, Section$, FilterName$, SrcDir$, Destination$
  1683.         Destination$ = ""
  1684. END SUB
  1685.  
  1686. '**    Adds each file in the given section to the list of files to be copied,
  1687. '** after checking to see if the file was installed by the administrator.
  1688. '*************************************************************************
  1689. SUB TestAddSectionFilesToCopyList (szSection$,szFrom$,szTo$) STATIC
  1690.     MakeListFromSectionKeys TempList$, szSection$
  1691.     FOR i% = 1 TO GetListLength(TempList$)
  1692.         szKey$ = GetListItem(TempList$, i%)
  1693.         szFileName$ = GetSectionKeyFilename( szSection$, szKey$ )
  1694.         IF DoesFileExist( MakePath(szFrom$,szFileName$), femExists) = 1 THEN 
  1695.             AddSectionKeyFileToCopyList szSection$, szKey$, szFrom$, szTo$
  1696.         ENDIF
  1697.     NEXT i%
  1698.     szFileName$ = ""
  1699.     szKey$ = ""
  1700. END SUB
  1701.  
  1702.